package com.tas.test.controller;

import com.tas.test.pojo.entity.SimpleData;
import com.tas.test.service.SimpleDataService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

/**
 * @Author kevin
 * @Date 2022-06-21 08:40
 * @Description
 */
@RestController
public class SimpleDataController {

  @Resource
  SimpleDataService simpleDataService;
  /**
   * 保存一条随机记录
   * @return
   */
  @GetMapping("/save")
  public Mono<SimpleData> save(){
    return simpleDataService.save();
  }

  /**
   * 保存一条随机记录
   * @return
   */
  @GetMapping("/query")
  public Flux<SimpleData> queryList(){
    return simpleDataService.queryList();
  }
}
